//
//  SimpleAnimationView.swift
//  TanTan_Kotlin
//
//  Created by EDY on 5/26/25.
//

import SwiftUI


struct SimpleAnimationView:View {
    @State private var isExpanded = false
    
    var body: some View {
        VStack {
            Rectangle()
                .fill(.purple)
                .frame(width: isExpanded ? 200 : 100, height: isExpanded ? 200 : 100)
                .animation(.default, value: isExpanded)
            Button("切换"){
                withAnimation {
                    isExpanded.toggle()
                }
            }
        }
    }
}


#Preview {
    SimpleAnimationView()
}
